package com.net.Thread;

public class JoinMain 
{

	public static void main(String[] args) throws InterruptedException
	{
		
		System.out.println(Thread.currentThread().getName()+ " Thread ");

		Thread t1 = new Thread() {
			
		  public void run()
		  {
			  
			  try
			  {
				System.out.println(Thread.currentThread().getName() + " Thread started");
				Thread.sleep(1000);
				
				System.out.println(Thread.currentThread().getName() + " Thread dead");
				  
			  } catch (Exception e) 
			  {
				System.out.println(e.getMessage());
			  }
		  }
			
		};
		
		
		t1.start();
		t1.join();
		
		System.out.println(Thread.currentThread().getName() + "  thread");
	}

}
